<style>
    body{
        background: url(./img/机车4.jpg);
        background-size: 100%;
    }
    div img{
width: 50px;
position: absolute;
}
</style>
<div><img src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20190523%2F3af7712782eb49f0816923b0c9912e97.jpeg&refer=http%3A%2F%2F5b0988e595225.cdn.sohucs.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1652870771&t=be232460ed348d54997650067843a7c6" alt=""></div>
<script>
    document.onmousemove =function(evt){
        var e = evt || window.event
        var left =e.pageX
        var top =e.pageY

        var divObj=document.querySelector('img')
        console.log()
        divObj.style.left =left +'px'
        divObj.style.top =top +'px'
    }
</script>